package com.itheima.IODemo;

import java.io.UnsupportedEncodingException;
import java.util.Arrays;

public class Demo07 {
    public static void main(String[] args) throws UnsupportedEncodingException {
        //关于解码和编码
        String str="ai你哟";
        byte[] bytes1 = str.getBytes();
        System.out.println(Arrays.toString(bytes1));

        byte[] bytes2 = str.getBytes("GBK");
        System.out.println(Arrays.toString(bytes2));

        System.out.println("----");

        String s = new String(bytes1);
        System.out.println(s);
        String s1 = new String(bytes2);
        System.out.println(s1);


    }
}
